Devise
Add devise gem
$ bundle add devise
Add devise to project and follow instruction in terminal
$ rails g devise:install
Create a model
model is normally user or admin
$ rails g devise Model
new model now contains 1) etc 2) etc 3) etc
then run $ rails db:migrate
to update database
Views for the user are being run in the background to have control over these views and add them to the project run
$ rails g devise:views
Working with the user
set up a controller with user authentication.Add this to controller
before_action :authenticate_user!